<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>
<div class="form">
	<?php $form=$this->beginWidget('CActiveForm', array(
		'id'=>'profile-field-form',
		'enableAjaxValidation'=>true,
	)); ?>
	
		<p class="note">Fields with <span class="required">*</span> are required.</p>
	
		<?php //echo $form->errorSummary($model); ?>
	
		<div class="row">
			<?php echo $form->labelEx($model,'name'); ?>
			<?php echo $form->textField($model,'name',array('size'=>30,'maxlength'=>255)); ?>
			<?php echo $form->error($model,'name'); ?>
		</div>
		
		<div class="row">
			<?php echo $form->labelEx($model,'label'); ?>
			<?php echo $form->textField($model,'label',array('size'=>30,'maxlength'=>255)); ?>
			<?php echo $form->error($model,'label'); ?>
		</div>
		
		<div class="row">
			<?php echo $form->labelEx($model,'type'); ?>
			<?php echo $form->dropDownList($model,'type',$model->getFieldTypes()); ?>
			<?php echo $form->error($model,'type'); ?>
		</div>
		
		<div class="row">
			<?php echo $form->labelEx($model,'dataType'); ?>
			<?php echo $form->dropDownList($model,'dataType',$model->getDataTypes()); ?>
			<?php echo $form->error($model,'dataType'); ?>
		</div>
		
		<div class="row">
			<?php echo $form->labelEx($model,'dataLength'); ?>
			<?php echo $form->textField($model,'dataLength',array('size'=>30,'maxlength'=>255)); ?>
			<?php echo $form->error($model,'dataLength'); ?>
		</div>
		<div class="row">
				<?php echo $form->labelEx($model,'options',array('class'=>'label')); ?>
				<?php echo $form->textArea($model,'options',array('cols'=>80)); ?>
				<?php echo $form->error($model,'options'); ?>
		</div>
		<div class="row">
			<?php echo $form->labelEx($model,'default'); ?>
			<?php echo $form->textField($model,'default',array('size'=>30,'maxlength'=>255)); ?>
			<?php echo $form->error($model,'default'); ?>
		</div>
		<fieldset class="validator">
			<legend>Validator:</legend>
			
			<div class="row">				
				<?php echo $form->checkBox($model,'required'); ?>
				<?php echo $form->error($model,'required'); ?>
				<?php echo $form->labelEx($model,'required'); ?>
			</div>
			<br />
			<div class="row">				
				<?php echo $form->checkBox($model,'email'); ?>
				<?php echo $form->error($model,'email'); ?>
				<?php echo $form->labelEx($model,'email'); ?>
			</div>
			<br />
			<div class="row">				
				<?php echo $form->checkBox($model,'url'); ?>
				<?php echo $form->error($model,'url'); ?>
				<?php echo $form->labelEx($model,'url'); ?>
			</div>
			<br />
			<div class="row">				
				<?php echo $form->checkBox($model,'numerical'); ?>
				<?php echo $form->error($model,'numerical'); ?>
				<?php echo $form->labelEx($model,'numerical'); ?>
			</div>
			<br />
			<div class="row">
				<?php echo $form->labelEx($model,'match',array('class'=>'label')); ?>
				<?php echo $form->textArea($model,'match',array('cols'=>80)); ?>
				<?php echo $form->error($model,'match'); ?>
			</div>
			<div class="row">
				<?php echo $form->labelEx($model,'in',array('class'=>'label')); ?>
				<?php echo $form->textArea($model,'in',array('cols'=>80)); ?>
				<?php echo $form->error($model,'in'); ?>
			</div>
			<br />
			
		</fieldset>
		<fieldset>
			<legend><?php echo $form->labelEx($model,'visible'); ?></legend>
			<div class="row visibility">
				<?php echo $form->radioButtonList($model,'visible',$model->getVisibleTypes()); ?>
				<?php echo $form->error($model,'visible'); ?>
				<br />
			</div>
		</fieldset>
		
		<div class="row buttons">
			<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
		</div>
	
	<?php $this->endWidget(); ?>
</div>